#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<vector>
#include<cstring>
#include<unordered_map>
#include<unordered_set>
#define int long long 
#define x first 
#define y second 
using namespace std;
const int N = 1e5 + 10;
vector<int> b;
void solve()
{
     string str;
     cin >> str;
     for(int i = 0; i < str.size() - 5; i++)
     {
          if(str.substr(i,6) == "friend") b.push_back(i);
     }
     int ans = 0;
     for(int i = 0; i < b.size(); i++)
     {
        ans ++ ;
        if(i < b.size()&&b[i+1] - b[i] < 9) i++;
     }
     cout << ans << endl;
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int t = 1;
    while(t--) solve();
    return 0;
}